package XPathProj;

import static org.junit.Assert.*;

import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;

import org.junit.Test;

public class XPathProjectImplementationTest {

	@Test
	public void testLoadXML() {
		fail("Not yet implemented");
	}

	@Test
	public void testEvaluateStringNodeQName() {
		fail("Not yet implemented");
	}

	@Test
	public void testEvaluateStringQName() {
		
		System.out.println("in test");
		
		XPathProjectImplementation impl = new XPathProjectImplementation();
		try {
			
			String proof = ((XpathNodeListImplementation) impl.evaluate("/inventory/book[(price>14 and price<2) or price=7.50]", XPathConstants.NODESET)).itemPath(0);
			
			assertEquals("/inventory/book{1}[((price{2}>14 and price{3}<2))]", proof);
			
		} catch (XPathExpressionException | IllegalArgumentException
				| NullPointerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Test
	public void testXPathProjectImplementation() {
		fail("Not yet implemented");
	}

}
